import { get, post } from '../fetch'

// 【商品分类】--获取列表
export const getJdGoodsInfoList = (params) => get('jdGoodsInfo/getList', params)
// 【商品分类】--新增数据
export const saveJdGoodsInfo = (params) => post('jdGoodsInfo/save', params)
// 【商品分类】--更新数据
export const editJdGoodsInfo = (params) => post('jdGoodsInfo/edit', params)
// 【商品分类】--删除数据
export const deleteJdGoodsInfo = (data) => post('jdGoodsInfo/delete/' + data, data)

export const getClassifyList = (params) => get('/jdGoodsInfo/getList', params) // 列表

// 【商品】--获取列表
export const getJdGoodsSpuList = (params) => get('jdGoodsSpu/getList', params)
// 【商品】--新增数据
export const saveJdGoodsSpu = (params) => post('jdGoodsSpu/save', params)
// 【商品】--更新数据
export const editJdGoodsSpu = (params) => post('jdGoodsSpu/edit', params)
// 【商品】--删除数据
export const deleteJdGoodsSpu = (data) => post('jdGoodsSpu/delete/' + data, data)

// * 商品管理
export const getGoodsCount = (params) => post('/jdGoodsSpu/getGoodsSummary', params)
export const getGoodsOrderList = (params) => post('/jdGoodsSpu/getGoodsOrderList', params)
export const getMGoodsSpuList = (params) => get('/jdGoodsSpu/getList', params)
export const saveMGoodsSpuInfo = (params) => post('/jdGoodsSpu/save', params)
export const getGoodsSkuInfo = (params) => post('/jdGoodsSku/getSkuInfoByGoodsId', params)

export const saveGoodsSkuInfo = (params) => post('/jdGoodsSku/saveSkuInfo', params)

export const deleteMGoodsSpuInfo = (params) => post('/jdGoodsSpu/delete', params)
export const getMAttrKeyListByparams = (params) => post('/jdAttrKey/getAttrKeyListByClassifyId', params)
export const queryItemListByGoodsIdAndStatus = (params) => post('/jdOrderItem/queryItemListByGoodsIdAndStatus', params)
export const updateNearbyGoodsState = (params) => post('/jdGoodsSpu/updateGoodsState', params)

// 【优惠券】--获取列表
export const getJdDiscountCouponList = (params) => get('jdDiscountCoupon/getList', params)
// 【优惠券】--新增数据
export const saveJdDiscountCoupon = (params) => post('jdDiscountCoupon/save', params)
// 【优惠券】--更新数据
export const editJdDiscountCoupon = (params) => post('jdDiscountCoupon/edit', params)
// 【优惠券】--删除数据
export const deleteJdDiscountCoupon = (data) => post('jdDiscountCoupon/delete/' + data, data)

// * 商品规格key
export const getMAttrKeyList = (params) => get('/jdAttrKey/getList', params) // 列表
export const getMAttrValueListByParams = (params) => post('/jdAttrValue/getAttrValueListByKeyIds', params)
export const saveMAttrKeyInfo = (params) => post('/jdAttrKey/save', params) // 添加
export const deleteMAttrKeyInfo = (params) => post('/jdAttrKey/delete', params) // 删除

// * 商品规格value
export const getMAttrValueList = (params) => get('/jdAttrValue/getList', params) // 列表
export const saveMAttrValueInfo = (params) => post('/jdAttrValue/save', params) // 添加
export const deleteMAttrValueInfo = (params) => post('/jdAttrValue/delete', params) // 删除

// * 商品参数组名称
export const getMSpecGrpList = (params) => get('/jdSpecGrp/getList', params) // 列表
export const saveMSpecGrpInfo = (params) => post('/jdSpecGrp/save', params) // 添加
export const deleteMSpecGrpInfo = (params) => post('/jdSpecGrp/delete', params) // 删除

// * 商品参数名称
export const getMSpecKeyList = (params) => get('/jdSpecKey/getList', params) // 列表
export const saveMSpecKeyInfo = (params) => post('/jdSpecKey/save', params) // 添加
export const deleteMSpecKeyInfo = (params) => post('/jdSpecKey/delete', params) // 删除

// * 商品参数值名称
export const getMSpecValueList = (params) => get('/jdSpecValue/getList', params) // 列表
export const saveMSpecValueInfo = (params) => post('/jdSpecValue/save', params) // 添加
export const deleteMSpecValueInfo = (params) => post('/jdSpecValue/delete', params) // 删除
